# Contributor: psykose <alice@ayaya.dev>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.nt>
pkgname=py3-tzdata
pkgver=2024.2
pkgrel=0
pkgdesc="Python package wrapping the IANA time zone database"
url="https://github.com/python/tzdata"
arch="noarch"
license="Apache-2.0"
depends="python3 py3-attrs"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest py3-pytest-subtests"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/python/tzdata/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/tzdata-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
34958742d110b84df0f3eaa27d7ec4e01f9332fb3f37749759bf7b6066fad847220e1500d80d6a4ce14e0585ceb4ca61e6d197da67c3ab4d1dfc10997693f497  py3-tzdata-2024.2.tar.gz
"
